class Notify():
    def __init__(self):
        super(Notify, self).__init__()

    def check(self, data, ch, text, value=None, check=True):
        """ Childing check of notifications for it deleting. """
        value = int(value) if '.0' in str(value) else value
        char = 'chapter' if check else 'series'
        tmp = f'{text} - new ' if value is None else \
              f'{text} - new {char} {value}'
        temp = f'{text} - new ova' if ch in 'anime' else 'NOT CHECK'
        data['notify'][ch] = [i for i in data['notify'][ch] if tmp not in i]
        data['notify'][ch] = [i for i in data['notify'][ch] if temp not in i]
        return data


    def empty(self, data):
        """ Checking cont of notifications. """
        el = [len(data['notify'][i]) for i in data['notify'] if i != 'notify']
        return True if sum(el) == 0 else False

    def show(self, data):
        """ Show all notifications. """
        data['notify']['notify'] = 'empty' if self.empty(data) else 'checked'
        el = 'No notify..' if self.empty(data) else \
                [data['notify'][i][::-1] for i in data['notify'] \
                if i not in 'notify']
        note = [*el[0], *el[1], *el[2]] if isinstance(el, list) else el

        return data, data['notify']['notify'], note
